<template>
  <div class="package-step">
    <el-row>
      <el-col :lg="16" :md="16" style="min-width:632px;">
        <el-steps :active="active" finish-status="success" simple>
          <el-step title="1.基本信息"/>
          <el-step title="2.课程管理"/>
          <el-step title="3.课程包管理"/>
        </el-steps>
      </el-col>
      <el-col :lg="8" :md="8">
        <div v-if="active === 1" style="float:right;height:46px;line-height:46px;">
          <el-button type="success" icon="el-icon-plus" @click="addStageClick">添加阶段</el-button>
          <el-button type="primary" icon="el-icon-plus" @click="addClassClick">添加课程</el-button>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { pushMessageBus } from './eventbus'
export default {
  props: {
    stepNumber: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
    }
  },
  computed: {
    active() {
      return this.stepNumber
    }
  },
  methods: {
    addStageClick() {
      pushMessageBus.$emit('fromStep-openAddStage')
    },
    addClassClick() {
      pushMessageBus.$emit('fromStep-openAddClass')
    }
  }
}
</script>

<style lang="scss" scoped>
.package-step {
  margin-top: 16px;
  .el-row {
    .el-col {
      text-align: center;
    }
  }
}
</style>
